/*
Package cmd
@Author   : Uyynot
@Email    : uyynot@qq.com
@Time     : 2024/4/12 16:06
@File     : play.go
@Project  : gohub
@Desc     :
*/
package cmd

import (
	"github.com/spf13/cobra"
	"gohub/pkg/console"
	"gohub/pkg/redis"
	"time"
)

var CmdPlay = &cobra.Command{
	Use:   "play",
	Short: "Likes the GO Playground, but running at our application context",
	Run:   runPlay,
}

// runPlay
// @Description: 存放调试代码
// @param cmd
// @param args
func runPlay(cmd *cobra.Command, args []string) {
	//存入redis
	redis.Redis.Set("hello", "hi from redis", 10*time.Second)
	//从redis中取出数据
	console.Success(redis.Redis.Get("hello"))
}
